<template>
	<view class="content">
		<view class="service">
			<view class="title">鞋柜名称：{{name}}</view>
			<image @click="navto('/pages/goods/goods_list')" src="https://www.sdxiecheng.cn/img/cunxie.png" style="margin-bottom: 80rpx;" mode=""></image>
			<image @click="orderList()" src="https://www.sdxiecheng.cn/img/quxie.png" mode=""></image>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				shoneId:0,
				name:''
			}
		},
		
		onLoad(e){
			console.log(e,'参数')
			this.$store.state.isScanCode = true
			if(e.q){
				let aaa = this.queryURLParams(decodeURIComponent(e.q))
				console.log(aaa,'参数')
				this.shoneId = aaa.id
			}else if(e.id){
				this.shoneId = e.id
			}
			this.getShoeInfo()
		},
		methods: {
			// 获取鞋柜信息
			getShoeInfo(){
				uni.$u.http.post('device/get_shoemsg',{
					id:this.shoneId
				}).then(res =>{
					this.$store.state.shoecabinet_id = res.data.id
					this.name = res.data.name
				})
			},
			orderList(){
				uni.setStorageSync('index',3)
				uni.$emit('updateOrder',{index:3})
				uni.navigateTo({
					url:'../order/order'
				})
			},
			navto(url){
				uni.navigateTo({
					url:url
				})
			},
			queryURLParams(url) {
			    let pattern = /(\w+)=(\w+)/ig; //定义正则表达式
			    let parames = {}; // 定义参数对象
			    url.replace(pattern, ($, $1, $2) => {
			      parames[$1] = $2;
			    });
			    return parames;
			  }
		}
	}
</script>

<style lang="less">
.content{
	padding: 20rpx;
	.service{
		display: flex;
		align-items: center;
		flex-direction: column;
		width: 100%;
		height: calc(100vh - 40rpx);
		background: #FFFFFF;
		border-radius: 10px;
		.title{
			margin-top: 60rpx;
			margin-bottom: 170rpx;
			font-size: 30rpx;
			font-weight: 500;
		}
		image{
			margin: 0 auto;
			width: 530rpx;
			height: 200rpx;
		}
	}
}
</style>
